/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package org.liquidByte.trafficMustang.server.dataModel;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.*;
import javax.validation.constraints.NotNull;

/**
 *
 * @author Alexandre
 */
@Embeddable
public class RastreamentoPK implements Serializable {
    @Basic(optional = false)
    @NotNull
    @Column(name = "USR_ID")
    private int usrId;
    @Basic(optional = false)
    @NotNull
    @Column(name = "RASTR_DT")
    @Temporal(TemporalType.TIMESTAMP)
    private Date rastrDt;

    public RastreamentoPK() {
    }

    public RastreamentoPK(int usrId, Date rastrDt) {
        this.usrId = usrId;
        this.rastrDt = rastrDt;
    }

    public int getUsrId() {
        return usrId;
    }

    public void setUsrId(int usrId) {
        this.usrId = usrId;
    }

    public Date getRastrDt() {
        return rastrDt;
    }

    public void setRastrDt(Date rastrDt) {
        this.rastrDt = rastrDt;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (int) usrId;
        hash += (rastrDt != null ? rastrDt.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof RastreamentoPK)) {
            return false;
        }
        RastreamentoPK other = (RastreamentoPK) object;
        if (this.usrId != other.usrId) {
            return false;
        }
        if ((this.rastrDt == null && other.rastrDt != null) || (this.rastrDt != null && !this.rastrDt.equals(other.rastrDt))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "org.liquidByte.trafficMustang.server.dataModel.RastreamentoPK[ usrId=" + usrId + ", rastrDt=" + rastrDt + " ]";
    }
    
}
